package com.xj.homework.pattern.delegate;

import java.util.HashMap;
import java.util.Map;

public class Leader {

    Map<String, IStaff> staffMap = new HashMap<>();
    public Leader() {
        staffMap.put("果农", new ProducerStaff());
        staffMap.put("果商", new SellerStaff());
    }

    public void dispatch(String str){
        staffMap.get(str).doWork();
    }
}
